Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
remark-message-control
Advanced tools
remark plugin to enable, disable, and ignore messages with remark
remark plugin to enable, disable, and ignore messages.
npm:
npm install remark-message-control
Say we have the following file, example.md
:
<!--foo ignore-->
## Heading
And our script, example.js
, looks as follows:
var vfile = require('to-vfile')
var report = require('vfile-reporter')
var remark = require('remark')
var control = require('remark-message-control')
remark()
.use(warn)
.use(control, {name: 'foo'})
.process(vfile.readSync('example.md'), function(err, file) {
console.error(report(err || file))
})
function warn() {
return function(tree, file) {
file.message('Whoops!', tree.children[1], 'foo:thing')
}
}
Now, running node example
yields:
example.md: no issues found
remark().use(control, options)
Let comment markers control messages from a certain sources.
options.name
Name of markers that can control the message sources (string
).
For example, {name: 'alpha'}
controls alpha
markers:
<!--alpha ignore-->
options.known
List of allowed ruleId
s (Array.<string>
, optional).
When given, a warning is shown when someone tries to control an unknown rule.
For example, {name: 'alpha', known: ['bravo']}
results in a warning if
charlie
is configured:
<!--alpha ignore charlie-->
options.reset
Whether to treat all messages as turned off initially (boolean
, default:
false
).
options.enable
List of ruleId
s to initially turn on if reset: true
(Array.<string>
,
optional).
By default (reset: false
), all rules are turned on.
options.disable
List of ruleId
s to turn on if reset: false
(Array.<string>
, optional).
options.sources
Sources that can be controlled with name
markers (string
or
Array.<string>
, default: options.name
).
disable
The disable keyword turns off all messages of the given rule identifiers. When without identifiers, all messages are turned off.
For example, to turn off certain messages:
<!--lint disable list-item-bullet-indent strong-marker-->
* **foo**
A paragraph, and now another list.
* __bar__
enable
The enable keyword turns on all messages of the given rule identifiers. When without identifiers, all messages are turned on.
For example, to enable certain messages:
<!--lint enable strong-marker-->
**foo** and __bar__.
ignore
The ignore keyword turns off all messages of the given ruleId
s occurring
in the following node.
When without ruleId
s, all messages are ignored.
After the end of the following node, messages are turned on again.
For example, to turn off certain messages for the next node:
<!--lint ignore list-item-bullet-indent strong-marker-->
* **foo**
* __bar__
Use of remark-message-control
does not involve rehype
(hast) or user content so there are no openings for
cross-site scripting (XSS) attacks.
Messages may be hidden from user content though, causing builds to fail or pass,
or changing a report.
See contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
remark plugin to enable, disable, and ignore messages with remark
The npm package remark-message-control receives a total of 135,861 weekly downloads. As such, remark-message-control popularity was classified as popular.
We found that remark-message-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.